fstats_experimental_design Module

Shared types for experimental design generation, modeling, and analysis.



Derived Types

type, public ::  doe_anova_table

ANOVA table for overall model fit assessment.

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: df_model

Model degrees of freedom.

integer(kind=int32), public :: df_residual

Residual degrees of freedom.

integer(kind=int32), public :: df_total

Total degrees of freedom.

real(kind=real64), public :: f_statistic

F-statistic.

real(kind=real64), public :: ms_model

Model mean square.

real(kind=real64), public :: ms_residual

Residual mean square.

real(kind=real64), public :: p_value

P-value for the F-test.

real(kind=real64), public :: r_squared

R-squared value.

real(kind=real64), public :: ss_model

Model sum of squares.

real(kind=real64), public :: ss_residual

Residual sum of squares.

real(kind=real64), public :: ss_total

Total sum of squares.

type, public ::  doe_comparison_result

Results from comparing two models.

Components

Type Visibility Attributes Name Initial
character(len=256), public :: conclusion

Interpretation of comparison results.

integer(kind=int32), public :: df_diff

Difference in degrees of freedom.

integer(kind=int32), public :: df_full

Degrees of freedom for full model.

integer(kind=int32), public :: df_reduced

Degrees of freedom for reduced model.

real(kind=real64), public :: f_statistic

F-statistic for model comparison.

real(kind=real64), public :: p_value

P-value for the F-test.

real(kind=real64), public :: rss_full

Residual sum of squares for full model.

real(kind=real64), public :: rss_reduced

Residual sum of squares for reduced model.

logical, public :: significant_difference

True if models differ significantly (p < 0.05).

type, public ::  doe_diagnostics

Model diagnostics and goodness-of-fit metrics.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: f_p_value

P-value for the overall F-statistic.

real(kind=real64), public :: f_statistic

Overall F-statistic for the model.

real(kind=real64), public :: mean_response

Mean of the response variable.

integer(kind=int32), public :: n_observations

Number of observations.

integer(kind=int32), public :: n_parameters

Number of model parameters (including intercept).

real(kind=real64), public :: r_squared

The coefficient of determination (R²), range [0, 1].

real(kind=real64), public :: r_squared_adjusted

The adjusted R² accounting for model complexity.

real(kind=real64), public :: residual_std_error

Residual standard error (standard deviation of residuals).

real(kind=real64), public :: rmse

Root mean square error.

type, public ::  doe_efficiency_metrics

Design efficiency metrics for evaluating design quality.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: a_efficiency

Higher is better.

real(kind=real64), public :: d_efficiency

Range [0,1]. Higher is better (max=1 for orthogonal designs).

real(kind=real64), public :: g_efficiency

G-efficiency: 1 - (max_prediction_variance / avg_prediction_variance)

logical, public :: is_orthogonal

True if design is perfectly orthogonal.

integer(kind=int32), public :: n_factors

Number of factors.

integer(kind=int32), public :: n_parameters

Number of model parameters.

integer(kind=int32), public :: n_runs

Number of design runs.

real(kind=real64), public :: orthogonality

Orthogonality measure: if perfectly orthogonal, otherwise.

type, public ::  doe_model

A model used to represent a design of experiments result. The model is of the following form.

Read more…

Components

Type Visibility Attributes Name Initial
real(kind=real64), public, allocatable, dimension(:) :: coefficients

The model coefficients, where N is the number of factors. The coefficients are ordered as follows, with each group included only if the model has a sufficient number of interaction levels.

Read more…
real(kind=real64), public, allocatable, dimension(:,:) :: covariance

The unscaled parameter covariance matrix , where is the design matrix used to fit the model. Only the parameters included in the model (map = true) are represented, in coefficient order.
This is populated by doe_fit_model, and is used to compute prediction intervals.

integer(kind=int32), public :: dof = 0

The residual degrees of freedom of the fit, . A value of zero indicates the fit information is not available (e.g. the model was not created by doe_fit_model).

logical, public, allocatable, dimension(:) :: map

An array denoting if a model coefficient should be included as part of the model (true), or neglected (false).

real(kind=real64), public :: mse = 0.0d0

The residual mean squared error of the fit, . This is only meaningful if dof > 0.

integer(kind=int32), public :: nway

The number of interaction levels.

type(regression_statistics), public, allocatable, dimension(:) :: stats

Statistical information for each model parameter.

type, public ::  doe_optimization_result

Results from RSM-based optimization.

Components

Type Visibility Attributes Name Initial
logical, public :: converged

Whether optimization converged.

real(kind=real64), public :: convergence_tolerance

Tolerance used for convergence.

integer(kind=int32), public :: iteration_count

Number of iterations to converge.

character(len=256), public :: method

Optimization method used.

real(kind=real64), public, allocatable, dimension(:) :: optimal_coded_factors

Optimal factor settings (in coded scale).

real(kind=real64), public, allocatable, dimension(:) :: optimal_natural_factors

Optimal factor settings (in natural scale).

real(kind=real64), public :: optimal_response

Predicted response at optimal point.

type, public ::  doe_prediction

Prediction with uncertainty quantification.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: confidence_level

Confidence level (e.g., 0.95 for 95% CI).

real(kind=real64), public, allocatable, dimension(:) :: confidence_lower

Lower confidence interval bounds.

real(kind=real64), public, allocatable, dimension(:) :: confidence_upper

Upper confidence interval bounds.

real(kind=real64), public, allocatable, dimension(:) :: predicted_values

Predicted response values.

real(kind=real64), public, allocatable, dimension(:) :: prediction_lower

Lower prediction interval bounds.

real(kind=real64), public, allocatable, dimension(:) :: prediction_upper

Upper prediction interval bounds.

type, public ::  doe_residuals

Residual analysis data.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public, allocatable, dimension(:) :: observed_values

Observed response values.

real(kind=real64), public, allocatable, dimension(:) :: predicted_values

Predicted response values.

real(kind=real64), public :: residual_mean

Mean of residuals (should be ~0).

real(kind=real64), public :: residual_std

Standard deviation of residuals.

real(kind=real64), public, allocatable, dimension(:) :: residuals

Raw residuals: y - y_predicted.

real(kind=real64), public, allocatable, dimension(:) :: standardized_residuals

Standardized residuals for outlier detection.

type, public ::  doe_rsm_model

Response Surface Model (quadratic model for RSM).

Components

Type Visibility Attributes Name Initial
type(doe_model), public :: base_model

Base fitted model.

real(kind=real64), public, allocatable, dimension(:) :: interaction_coeff

Interaction coefficients.

real(kind=real64), public :: intercept

Model intercept.

real(kind=real64), public, allocatable, dimension(:) :: linear_coeff

Linear coefficients for each factor.

integer(kind=int32), public :: n_factors

Number of factors.

real(kind=real64), public, allocatable, dimension(:) :: quadratic_coeff

Quadratic coefficients (main effects squared).

real(kind=real64), public :: response_at_center

Predicted response at design center (coded 0,0,...,0).